package com.mycar2w.cloud.web.util;

import org.springframework.web.servlet.ModelAndView;

import java.util.HashMap;
import java.util.Map;

/**
 * created time 2017/4/2
 *
 * @author ljc
 * @version V1.0
 */
public class ReturnModelAndView{
    private static ModelAndView modelAndView=new ModelAndView();

    private static Map<String,Object> map=new HashMap<>();

    public static ModelAndView returnSuccess(String view){
        modelAndView.setViewName(view);
        return modelAndView;
    }
    public static ModelAndView returnSuccess(String view,Object content){
        modelAndView.setViewName(view);
        modelAndView.addObject("content",content);
        return modelAndView;
    }
    public static ModelAndView returnFail(String view,Object content){
        modelAndView.setViewName(view);
        modelAndView.addObject("errorMessage",content);
        return modelAndView;
    }

}
